#include <windows.h>
#include <stdio.h>
	
#define BUFSIZE 512

#ifdef ALERT
const char * ModuleName = "alert";
#endif

#ifdef CONFIRM
const char * ModuleName = "confirm";
#endif

const char * dft_title = "Error";
const char * dft_msg = "Error";

    	
void printUsage();
	
int main(int argc, char ** argv)
{
  const char * title=dft_title;
  const char * msg=dft_msg;
  UINT uType;
    
  if(argc>3)
    {
      printUsage();
      return 1;
    }

  if(argc > 2)
    {
      title = argv[2];
    }

  if(argc > 1)
    {
      msg = argv[1];
    }
#ifdef ALERT
  uType = MB_OK;
#endif

#ifdef CONFIRM
  uType = MB_OKCANCEL|MB_ICONQUESTION;
#endif  
  if (IDCANCEL == MessageBox(NULL, msg, title, uType)){
    return 1;
  }
  
  return 0;
}

void printUsage()
{
  printf("Display a modal dialog to %s\n");
  printf("version 1.0\n");
  printf("\tReleased under GPL\n");
  printf("\tYou can send a mail to sevenever@gmail.com for source\n");
  printf("\tBy sevenever,bug report to sevenever@gmail.com\n");
  printf("\nUsage: %s [[message], title]\n", ModuleName);
}
